#!/bin/sh
c=0
for ((i=0;i<5;i++))
do

x=`./random 1 5`
  for ((j=0;j<3;j++))
  do
   
     echo "输入一个数："
     read m
        if [ $m -eq $x ];then
        echo "恭喜！你猜中了"
          c=$(($c+1))
          break
     elif [ $m -lt $x ];then
        echo "小于目的数"
     elif [ $m -gt $x ];then
        echo "大于目的数"
            
     fi
  done
done
echo "你的得分是"$c
